<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加产品</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
	<table class="layout2col1">
        <tbody>
            <tr>
            	<td id="prdTypTD" width="20%" valign="top">
            		<div class="sqPanel">
                        <div class="sqPanel_head">
                        	<div class="label">产品类型</div>
                        </div>
                        <div class="sqPanel_body" style="min-height: 300px;">
                        	<ul id="tree1"></ul>
                        </div>
                    </div>
            	</td>
            	<td valign="top" id="prdInfoDiv">
<form id="formSet1">
                        <div class="fieldset1 tabel_col clearFix">
                        	<div class="caption">
		                        <span class="title">产品信息</span>
		                    </div>
				            <div id="dyncBizdiv" class="fieldBox col_100_auto">
			                	<%-- <jsp:include page="prdBscInfoAddDynamicPage.jsp"></jsp:include> --%>
			                </div>
			                <div class="fieldBox col_50">
	                        	<div class="label">产品品牌</span></div>
				                <div class="field">
				                   <input type="text" name="brCd" id="brCd" placeholder="请选择" validate ="{required:true}"/>
				                    <span class="requiredSymbol">*</span>
				                </div>
				            </div>
			                <div class="fieldBox col_50">
				            	<div class="label">建议价格(元)</div>
				                <div class="field">
				                    <input name="guidePcDouble" id="guidePcDouble" type="text" data-tofix="2" class="ui-textbox" value="" validate ="{required:true,number:true}">
				                    <span class="requiredSymbol">*</span>
				                </div>
				            </div>
				            <div class="fieldBox col_50">
	                        	<div class="label">设备状态 (是否启用)</span></div>
				                <div class="field">
				                   <select name="isValid" id="isValid" data-value=" " >
				                       <option value="1" selected="selected">是</option>		
				                       <option value="0">否</option>
				                    </select>
				                </div>
				            </div>
				            <div id="dyncCardiv">
			                	<%-- <jsp:include page="prdCarInfoAddDynamicPage.jsp"></jsp:include> --%>
			                </div>
			                <div class="fieldBox col_100" id="mfrDiv">
	                        	<div class="label">产品所属厂商</span></div>
				                <div class="field">
				                	<input name="mfrId" id="mfrId" type="text" value="" placeholder="请选择" ltype="combobox">
				                	<span id="mfrIdSpan" class="requiredSymbol">*</span>
				                </div>
				            </div>
				            <div class="fieldBox col_100">
				            	<div class="label">备注</div>
				                <div class="field">
				                    <textarea name="prdRem" id="prdRem" rows="4" class="l-textarea" style="width:99%" value="" ></textarea>
				                </div>
				            </div>
                        </div>
            			
            			<div id="btnsBox" class="btnsBox">
			                <span id="saveBtn1" class="sq-button sq-button-round">保存</span>
			                <c:if test="${isShowAuditBtn==1 }">
				                <span id="passBtn" class="sq-button sq-button-round" onclick="auditPass(${id});">审核通过</span>
				                <span id="noPassBtn" class="sq-button sq-button-round" onclick="auditNoPass(${id});">审核不通过</span>
			                </c:if>
		                    <input name="pId" id="pId" type="hidden" value="${id }">
		                    <input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
			            </div>
</form>
			            <div class="fieldset1 tabel_col clearFix" id="dyncTkListdiv">
				            <div class="caption">
		                        <span class="title">产品详细列表</span>
		                    </div>
		                    <div class="fieldBox col_100_auto">
								<jsp:include page="../prdTkInfo/prdTkInfoList.jsp"></jsp:include>
							</div>
						</div>
			            <div class="fieldset1 tabel_col clearFix" id="dyncTkBusListdiv">
				            <div class="caption">
		                        <span class="title">产品详细列表</span>
		                    </div>
		                    <div class="fieldBox col_100_auto">
								<jsp:include page="../prdTkBusInfo/prdTkBusInfoList.jsp"></jsp:include>
							</div>
						</div>
            	</td>
            </tr>
		</tbody>
	</table>
</div>
</body>

<script type="text/javascript">
var selectData,
	prdData,
	_prdCd;
	
var _prdId="${id }";
var isSure = true;	
var isLink = '${isLink}'

var _bizTypCd;	//目标代码组值
var _bizCd;	//目标代码值
var _sGrpCd;	//源代码组值
var _sCode;//源代码值

$(function () {
	var id = $("#pId").val();
	if(id){//如果有ID 说明是修改进来的  选中产品类型无需确认
		isSure = false;
	}
	//产品类型树
	tree = $("#tree1").ligerTree({
    	url: '<%=path%>/product/prdBscInfo/getPrdTyeData.do',
        ajaxType: 'get',
        checkbox: false,
        isExpand: false, 
        parentIcon: "SqFolder",
        childIcon: "SqLeaf",
        textFieldName:"tName",
        idFieldName:"tCode",
        onSelect: onSelectTree,
        isExpand:function(e){
        	return e.data.treedataindex == 0;
        },
        needCancel : false,
        onBeforeSelect:function(node){
        	if(node.data.children){
           		top.$.ligerDialog.SQalert({content: LogUtils.LOG_PRD_CHECK_PRD_TYPE , SQ_type: "warning" });
        		return false;
           	}
        	var sss = false;
        	if(isSure){
        		top.$.ligerDialog.confirm("确认切换产品类型吗?可能导致录入信息丢失!", function (flag) {
    				sss = flag
    				if(flag){
    					(function(){tree.selectNode(node.data)})();
    				}
    			});
        	}
        	return sss;
        },
        onSuccess:function(data){
        	initData(data);
        }
    });
	//实例化品牌模糊搜索下拉框
	$("#brCd").ligerComboBox({
        url: '<%=path%>/product/prdBscInfo/searchBrCdJSON.do',
        ajaxType: "get",
        //parms:{mTypCd:'M0002', sGrpCd:_sGrpCd, sCode:_sCode},
        width: 178,
        valueField: 'key',
		textField: 'value',
        autocomplete: function (e){
            filter_autoComboboxData(e.key, this);
            e.show();
        },
        onChangeValue: function (value) {
            if (this.findValueByText(value) == "") {//清除输入值
                liger.get("brCd").setValue("");
            }
        }
    });
	 var form = $("#formSet1").ligerForm({
			validate: true
	 });
	$("#saveBtn1").click(function(event) {
	    $("#formSet1").ligerForm({
			validate: true
	 		});
	    var form = liger.get("formSet1");
	    if (!form.valid()) {
	    	top.$.ligerDialog.SQalert({content:LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
	    //未选择产品类型不通过
	    if(!_prdCd){
	    	top.$.ligerDialog.SQalert({content:"请选择产品类型!", SQ_type: "warning"});
            return false;
	    }
	    var data = form.getData();
		data["brCd"] = liger.get("brCd").getValue();//品牌
		
		data["prdCd"] = _prdCd;//产品代码
		data["mfrNm"] = liger.get("mfrId").getText(); //$("#mfrId option:selected").text();//厂商名称
		var id = $("#pId").val();
       	var url='<%=path%>/product/prdBscInfo/add.do';
       	if(id != ""){
        	url = '<%=path%>/product/prdBscInfo/modify.do';
        	data["id"]= id;
        }
       	
       	//校验是否是下拉选产品名称 
       	if($("#prdNm").attr("selectFlag")=="1"){
			data["prdCd"] = liger.get("prdNm").getValue();//产品代码
			data["prdNm"] = liger.get("prdNm").getText();//产品名称
       	}
       	
       	var wait_dialog;
	    $.ajax({
			type: 'post',
			dataType:'json',
			data:data,
			url: url,
			beforeSend: function(){
		          wait_dialog=top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		    },
			success:function(msg){
				wait_dialog.close();
				 if(msg.success == 1){
					 if(msg.data){
						 $("#pId").val(msg.data);
						 _prdId = msg.data;
					 }
					 
					 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
					 //回调刷新列表
					 var callback=GET_W2Wcallback();
		             callback();
				 }else{
					 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
				 }
			}
		});
	});
})

	//审核通过
	function auditPass(_prdId){
		if(StringUtils.isEmpty(_prdId)) return;
		var url = '<%=path%>/product/prdBscInfo/modifyAudStsCd.do';
	    var wait_dialog;
	    $.ajax({
			type: 'post',
			dataType:'json',
			data:{id:_prdId,audStsCd:FlowConstant.FLOW_CHECK_STATE_PASS},
			url: url,
			beforeSend: function(){
		          wait_dialog=top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
			success:function(msg){
				 wait_dialog.close();
				 if(msg.success == 1){
					 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
					//回调刷新列表
					 var callback=GET_W2Wcallback();
		             callback();
				 }else{
					 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
				 }
			}
		});
	}
	//审核不通过
	function auditNoPass(_prdId){
		if(StringUtils.isEmpty(_prdId)) return;
		var url = '<%=path%>/product/prdBscInfo/modifyAudStsCd.do';
	    var wait_dialog;
	    $.ajax({
			type: 'post',
			dataType:'json',
			data:{id:_prdId,audStsCd:FlowConstant.FLOW_CHECK_STATE_NO_PASS},
			url: url,
			beforeSend: function(){
		          wait_dialog=top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
			success:function(msg){
				 wait_dialog.close();
				 if(msg.success == 1){
					 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
					//回调刷新列表
					 var callback=GET_W2Wcallback();
		             callback();
				 }else{
					 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
				 }
			}
		});
	}
	
	
	function initData(selectData){
			var id = $("#pId").val();
			if(!id){
				//isSure = false;
				if(selectData[0].children){
					tree.selectNode(selectData[0].children[0]);
				}else{
					tree.selectNode(selectData[0]);
				}
				return;
			}
			$("#prdTypTD").hide();//隐藏树
	    	//parent.pageInApp.spl_id = id;
	    	var _url = '<%=path%>/product/prdBscInfo/getById.do';
	    	$.ajax({
	    		type: 'get',
	    		dataType:'json',
	    		data:{id:id},
	    		url: _url,
	    		success:function(msg){
	    			 if(msg.success == 1){
	    				 //根据产品代码(完整的产品类型代码)  设置选中树
	    				 selectData = msg.data.prdTypCd;
	    				 if(tree){
		    				 tree.selectNode(selectData);
	    				 }
	    				 prdData = msg.data;
	    				 setData(msg.data);//设置数据
	    			 }else{
	    				 $.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
	    			 }
	    		}
	    	});
    	}
    //设置固定字段数据	
	function setData(data){
		var form = liger.get("formSet1");
		form.setData({
    		mfrId:data.mfrId,
    		//brCd:data.brCd,
    		guidePcDouble:data.guidePcDouble,
    		prdRem:data.prdRem,
    		isValid:data.isValid.toString()
    	});
	}
    //设置动态字段数据
	function setOthData(data){
		$("#brCd").ligerGetComboBoxManager().selectValue(data.brCd);
		var form = liger.get("formSet1");
		if($("#prdNm").attr("selectFlag")=="1"){
			form.setData({
				prdNm:data.prdCd
			});
		}else{
			form.setData({
				prdNm:data.prdNm
			});
		}
		form.setData({
			prdMdl:data.prdMdl,
			prdClsCd:data.prdClsCd
		});
		var prdCarInfoVO = data.prdCarInfoVO;
		if(prdCarInfoVO){
			form.setData({
				carLen:prdCarInfoVO.carLen,
				prdLvlCd:prdCarInfoVO.prdLvlCd,
				prdYr:prdCarInfoVO.prdYr,
				prdCyCd:prdCarInfoVO.prdCyCd,
				outVol:prdCarInfoVO.outVol,
				grboxTypCd:prdCarInfoVO.grboxTypCd,
				grboxCfg:prdCarInfoVO.grboxCfg,
				seatQtyCd:prdCarInfoVO.seatQtyCd,
				engMdl:prdCarInfoVO.engMdl,
				drvTypCd:prdCarInfoVO.drvTypCd,
				carStrcCd:prdCarInfoVO.carStrcCd,
				carStrcCfg:prdCarInfoVO.carStrcCfg,
				powerTypCd:prdCarInfoVO.powerTypCd,
				carCl:prdCarInfoVO.carCl,
				maxSpd:prdCarInfoVO.maxSpd,
				prdWayCd:prdCarInfoVO.prdWayCd,
				carMdl:prdCarInfoVO.carMdl,
				othCfg:prdCarInfoVO.othCfg,
				emiStdCd:prdCarInfoVO.emiStdCd,
				batDeg:prdCarInfoVO.batDeg,
				extMil:prdCarInfoVO.extMil,
				carVol:prdCarInfoVO.carVol
			});
		}
}
	
function onSelectTree (node) {
   	sendURL(node);
 }
 
 var _prdTypCd;//产品类型
	 //刷新组件
	 function sendURL(node){
		 // 刷新组件前清除页面已有数据 包括录入值  保存过返回的ID 以及子产品列表
		 if(isSure){
			 $("#resetBtn").click();
			 liger.get("isValid").selectValue("1");
			 $("#pId").val("");
			 _prdId = '';
			 tkGrid.setParm("prdId",_prdId);
			 tkGrid.reload();
		 }
		 
		 
	 	_prdCd = node.data.tCode;
	 	_prdTypCd = node.data.tCode;
	   	_bizTypCd = node.data.tGrpCd;	//目标代码组值
	   	_bizCd = node.data.tCode;	//目标代码值(产品类型)
	   	_sGrpCd = node.data.sGrpCd;	//源代码组值
		_sCode = node.data.sCode;	//源代码值(产品特征分类)
		
		_bizCd = _bizCd.substring(0,3);//产品动态字段根据一级产品类型刷新即可
		
	   	var _prdTypCdNm = node.data.tName;	//目标代码名
	   	
	   	var _pTypNm;
	   	var pNode = tree.getParent(node, 1);
	   	if(pNode){
	   		_pTypNm = pNode.tName;	//父节点名
	   	}
	   	//根据选择类型刷新品牌下拉数据
	   	$.ajax({
			type: 'post',
			dataType:'json',
			data:{mTypCd:'M0002', sGrpCd:_sGrpCd, sCode:_sCode},
			url:'<%=path%>/product/prdBscInfo/searchBrCdJSON.do',
			success:function(data){
				//console.log(data);
				var brCd = liger.get("brCd");
				if(brCd){
					brCd.setData(data,true);
					//console.log("===brCd.setData(data)===");
				}
			}
		});
	   	
	   	
	   	
		//刷新动态组件
	    var _url_1 = '<%=path%>/product/prdBscInfo/toPrdDynamicFldPage.do';
	    var _url_2 = '<%=path%>/product/prdBscInfo/toCarDynamicFldPage.do';
		var wait_dialog_refresh_field = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
	    $("#dyncBizdiv").load(_url_1,{bizTypCd:_bizTypCd, bizCd:_bizCd, prdTypCd:_prdTypCd, prdTypCdNm:_prdTypCdNm, pTypNm:_pTypNm},function(responseText,textStatus){
			dynamicBizPageUIInst();
			//$("#formSet1").check_ligerFormEditor();
			$("#dyncCardiv").load(_url_2,{bizTypCd:_bizTypCd, bizCd:_bizCd, prdTypCd:_prdTypCd, prdTypCdNm:_prdTypCdNm, pTypNm:_pTypNm},function(responseText,textStatus){
				wait_dialog_refresh_field.close();
				$("#formSet1").check_ligerFormEditor();
				
				//判断产品名称是否下拉框
				if($("#prdNm").attr("selectFlag")=="1"){
					//console.log("===1111===");
					
					//根据产品类型 获取产品名称下拉框数据
					$.ajax({
						type: 'post',
						dataType:'json',
						async: false,
						data:{prdTypCd:_prdCd},
						url:'<%=path%>/product/prdBscInfo/getPrdNmData.do',
						success:function(data){
							//liger.get("prdNm").setData(data);   
							var prdNm = $("#prdNm");
		       				if(prdNm.length ){
			       				$("#prdNm").empty();
		       					//$("#prdNm").append("<option value=''>请选择</option>");
			       				$.each(data,function(index,obj) {
			       					var option = "<option value='"+obj.key+"'>"+obj.value+"</option>";
			       					$(option).appendTo("#prdNm");
			       				 	liger.get("prdNm").setSelect();
			       				});
			       				$("#prdNm").add_ligerFormEditor();
		       				}
						}
					});
				}
				
				//屏蔽主产品信息修改保存操作
			    if(isLink==1){
			    	disabledBsc();
			    }
				
				//动态组件加载完成之后 根据所选产品类型 设置驱动下拉框的值
				$.ajax({
		       		type: 'post',
		       		dataType:'json',
		       		data:{mTypCd:'M0003', sGrpCd:_sGrpCd, sCode:_sCode},
		       		url: '<%=path%>/product/prdBscInfo/searchSysCdMapDWithTargetAtomForSelect.do',
		       		success:function(msg){
		       			 if(msg.success == 1){
		       				//设置驱动值-乘用车
		       				var drvTypCd = $("#drvTypCd");
		       				if(drvTypCd.length ){
			       				$("#drvTypCd").empty();
		       					$("#drvTypCd").append("<option value=' '>请选择</option>");
			       				$.each(msg.data,function(index,obj) {
			       					var option = "<option sGrpCd='"+obj.sGrpCd+"' sCode='"+obj.sCode+"' value='"+obj.tCode+"'>"+obj.tCodeNm+"</option>";
			       					$(option).appendTo("#drvTypCd");
			       				 	liger.get("drvTypCd").setSelect();
			       				});
			       				$("#drvTypCd").add_ligerFormEditor();
			       				//liger.get("drvTypCd").selectValue(msg.data[0].tCode);
		       				}
		       			 }else{
		       				 $.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
		       			 }
		       			if(prdData){
							setOthData(prdData);//设置动态字段的值
						}
		       		}
	       		});
				//动态组件加载完成之后 根据所选产品类型 设置排放标准下拉框的值
				$.ajax({
		       		type: 'post',
		       		dataType:'json',
		       		data:{mTypCd:'M0018', sGrpCd:_sGrpCd, sCode:_sCode},
		       		url: '<%=path%>/product/prdBscInfo/searchSysCdMapDWithTargetAtomForSelect.do',
		       		success:function(msg){
		       			 if(msg.success == 1){
		       				//设置驱动值-乘用车
		       				var emiStdCd = $("#emiStdCd");
		       				if(emiStdCd.length ){
			       				$("#emiStdCd").empty();
		       					/* $("#emiStdCd").append("<option value=' '>请选择</option>"); */
			       				$.each(msg.data,function(index,obj) {
			       					var option = "<option sGrpCd='"+obj.sGrpCd+"' sCode='"+obj.sCode+"' value='"+obj.tCode+"'>"+obj.tCodeNm+"</option>";
			       					$(option).appendTo("#emiStdCd");
			       				 	liger.get("emiStdCd").setSelect();
			       				});
			       				$("#emiStdCd").add_ligerFormEditor();
		       				}
		       			 }else{
		       				 $.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
		       			 }
		       			if(prdData){
							setOthData(prdData);//设置动态字段的值
						}
		       		}
	       		});
				//动态组件加载完成之后 根据所选产品类型 设置变速箱类型下拉框的值
				/*$.ajax({
		       		type: 'post',
		       		dataType:'json',
		       		data:{mTypCd:'M0004', sGrpCd:_sGrpCd, sCode:_sCode},
		       		url: '<%=path%>/product/prdBscInfo/searchSysCdMapDWithTargetAtomForSelect.do',
		       		success:function(msg){
		       			 if(msg.success == 1){
		       			//设置变速箱类型-乘用车/客车
	       				var grboxTypCd = $("#grboxTypCd");
	       				if(grboxTypCd.length ){
		       				$("#grboxTypCd").empty();
	       					$("#grboxTypCd").append("<option value=' '>请选择</option>");
		       				$.each(msg.data,function(index,obj) {
		       					var option = "<option sGrpCd='"+obj.sGrpCd+"' sCode='"+obj.sCode+"' value='"+obj.tCode+"'>"+obj.tCodeNm+"</option>";
		       					$(option).appendTo("#grboxTypCd");
		       				 	liger.get("grboxTypCd").setSelect();
		       				});
		       				$("#grboxTypCd").add_ligerFormEditor();
		       				//liger.get("grboxTypCd").selectValue(msg.data[0].tCode);
	       				}
		       			 }else{
		       				 $.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
		       			 }
		       		}
	       		});*/
	       		
	       		//设置车辆规模禁用
				if(liger.get("prdLvlCd")){
					liger.get("prdLvlCd").setDisabled(true);
				}
			});
		});
 	}
	 	
		 var comboGrid_defaultValue="${mfrId}"; //初始值(value)
	     var comboGrid_defaultText="${mfrNm}"; //初始值(text)
	     var isInit_setSearchComboVal = false; //是否初始化的时候已经赋完初始值？
		//厂商带搜索
		//var comboGrid_defaultValue = "${mfrId}"; //厂商初始值
		var combo_Mng = $("#mfrId").ligerComboBox({
         width: 350, 
         selectBoxWidth: 350,
         selectBoxHeight: 240,
         valueField: 'id',
         textField: 'mfrNm',
         isMultiSelect: true,
         grid: getGridOptions(true),
         condition: {
             labelWidth: 0,
             space: 5,
             fields: [{ name: 'mfrNm', width: 150, keyName: 'id'}]
         },
         delayLoadGrid: false,
         onChangeValue: function (value) {
             if (combo_Mng) {
             	if (value=="") comboGrid_defaultValue = ""; //如果点击清空'x'，就滞空初始值
                //$("#mfrId").show_ligerComboItems();
             };
             SetIframe_height();
         }
     });
     //$("#mfrId").ligerGetComboBoxManager().updateStyle();//初始值之后需要刷新组件才有变化
     function getGridOptions(checkbox)
     {
    	 var url; 
		 var _pId = $("#pId").val();
	 	 if(!_pId){
	 		 url = '<%=path%>/product/mfrInfo/initList.do?flag=quote'
	 	 }else{
	 		 url = '<%=path%>/product/mfrInfo/initList.do?flag=quote&mfrIdsString='+ comboGrid_defaultValue
	 	 }
         var options = {
         	usePager: false,
             columns: [
                 { display: '厂商名称', name: 'mfrNm', minWidth: 300 }
             ],
             switchPageSizeApplyComboBox: false,
             url : url,
             method: 'get',
             dataAction: 'local',
             pageSize: 10,
             root:'rows',
             record:'total',
             rownumbers:true,
             usePagerOnLessPagesize: false,
             cssClass: "SMALL_grid",
             frozen: false,
             isSelected: function (rowdata) {
                 if (comboGrid_defaultValue == "") return false;
                 var defaultItems = comboGrid_defaultValue.split(";");
                 if(!isInit_setSearchComboVal) { //只在初始化时执行一次，在onAfterShowData后改变
	                 for (var i = 0; i < defaultItems.length; i++) {
	                 	if(rowdata[combo_Mng.options.valueField] == defaultItems[i]) return true;
	                 }
                 }
                 return false;
             },
             onAfterShowData: function (currentData) {
            	 if(!isInit_setSearchComboVal) { //只在初始化时执行一次，在onAfterShowData后改变
	                	//combo_Mng.selectValue(comboGrid_defaultValue);
	                	combo_Mng.setInputValue(comboGrid_defaultValue, comboGrid_defaultText, true);
	                    isInit_setSearchComboVal = true;
             	}
             }
         };
         return options;
     }
     
     function disabledBsc(){
    	 //隐藏子产品新增,主产品保存按钮
    	 $("#saveBtn1").hide();
    	 //$("#addBtn").hide();
    	 
    	 if(liger.get("prdNm")){
	    	 liger.get("prdNm").setDisabled(true);
    	 }
    	 if(liger.get("prdMdl")){
	    	 liger.get("prdMdl").setDisabled(true);
    	 }
    	 if(liger.get("prdTypCd")){
	    	 liger.get("prdTypCd").setDisabled(true);
    	 }
    	 if(liger.get("prdTypCdNm")){
	    	 liger.get("prdTypCdNm").setDisabled(true);
    	 }
    	 if(liger.get("prdClsCd")){
	    	 liger.get("prdClsCd").setDisabled(true);
    	 }
    	 if(liger.get("brCd")){
	    	 liger.get("brCd").setDisabled(true);
    	 }
    	 if(liger.get("guidePcDouble")){
	    	 liger.get("guidePcDouble").setDisabled(true);
    	 }
    	 if(liger.get("isValid")){
	    	 liger.get("isValid").setDisabled(true);
    	 }
    	 if(liger.get("mfrId")){
	    	 liger.get("mfrId").setDisabled(true);
    	 }
    	 $("#prdRem").setDisabled_ligerTextarea(true);
     }
     
     function carLenChange(){
    	 var carLen = $("#carLen").val();
    	 //console.log("carLen:"+carLen);
    	 if(!NumberUtils.isUnsignedNumeric(carLen)) return;
    	 if(liger.get("prdLvlCd")){
	    	 var prdLvlCd_li = liger.get("prdLvlCd");
	    	 //判断长度
	    	 if(parseFloat(carLen)<=5.7){
	    		 prdLvlCd_li.selectValue("轻型客车");
	    	 }else if((parseFloat(carLen)>=10)){
	    		 prdLvlCd_li.selectValue("大型客车");
	    	 }else{
	    		 prdLvlCd_li.selectValue("中型客车");
	    	 }
    	 }
    	 
     }
 
</script>